<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<%@ include file="/WEB-INF/views/include/header.jsp" %>
<form:form commandName="taskjob" cssClass="form-horizontal" role="form" onsubmit="return false;">

    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right" for="taskName">*任务标题</label>
        <div class="col-sm-4">
            <input type="text" name="taskName" id="taskName" placeholder="任务名称" value="${taskjob.taskName}"
                   class="form-control " required>
        </div>
        <label class="col-sm-2 control-label no-padding-right" for="taskType">*事项类型</label>
        <div class="col-sm-4">
            <select name="taskType" id="taskType" class="form-control">
                <option value="">点击选择</option>
                    <%--  <option value="重点工作">重点工作</option>
                      <option value="日常事务">日常事务</option>
                      <option value="突发督查">突发督查</option>--%>
                <option value="会议纪要">会议纪要</option>
                <option value="省市县为民办实事">省市县为民办实事</option>
                <option value="省市县政府工作报告">省市县政府工作报告</option>
                <option value="政协提案办理">政协提案办理</option>
                <option value="其他事项">其他事项</option>
                JM
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right" for="taskContent">*内容事项</label>
        <div class="col-sm-10">
            <textarea rows="5" id="taskContent" name="taskContent" placeholder="任务内容" value="${taskjob.taskContent}" style="resize: vertical;min-height: 100px"
                      class="form-control " required/>
        </div>
    </div>
    <div class="form-group">
            <%-- <label class="col-sm-2 control-label no-padding-right" for="planStartDate">开始时间</label>
             <div class="col-sm-4">
                 <input type="text" name="planStartDate" id="planStartDate" placeholder="计划开始时间"
                        value="${taskjob.planStartDate}" class="form-control date-picker" required readonly>
             </div>--%>
        <label class="col-sm-2 control-label no-padding-right" for="planEndDate">办理时限</label>
        <div class="col-sm-4">
            <input type="text" name="planEndDate" id="planEndDate" placeholder="计划结束时间" value="${taskjob.planEndDate}"
                   class="form-control date-picker" required readonly>
        </div>
        <label class="col-sm-2 control-label no-padding-right" for="resDept">承办单位</label>
        <div class="col-sm-4">
            <select name="resDept" id="resDept" class="form-control" required>
                <option value="">请选择</option>
                <c:forEach items="${bookLists}" var="bookLists">
                    <option value="${bookLists.deptCode}">${bookLists.deptName}</option>
                </c:forEach>
            </select>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right" for="remindObj">抄送对象</label>
        <div class="col-sm-4">
            <select name="remindObj" id="remind-obj" class="form-control">
                <option value="">请选择</option>
                <c:forEach items="${bookLists}" var="bookLists">
                    <option value="${bookLists.deptCode}">${bookLists.deptName}</option>
                </c:forEach>
            </select>
        </div>
    <%--    <label class="col-sm-2 control-label no-padding-right" for="remind-obj">抄送对象</label>
        <div class="col-sm-4">
            <input type="text" name="remindObj" id="remind-obj" placeholder="抄送对象" value="${taskjob.remindObj}"
                   class="form-control ">
        </div>--%>
    </div>


    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right" for="groupList">督查组别</label>
        <div class="col-sm-4">
            <select name="groupList" id="groupList" class="form-control">
                <option value="">请选择</option>
                <c:forEach items="${groupList}" var="groupLists">
                    <option value="${groupLists.groupCode}">${groupLists.groupName}</option>
                </c:forEach>
            </select>
        </div>
        <label class="col-sm-2 control-label no-padding-right" for="resUser">责任人</label>
        <div class="col-sm-4">
            <%--<input type="text" name="resUser" id="resUser" placeholder="责任人" value="${taskjob.resUser}"
                   class="form-control ">--%>
                <select name="resUser" id="resUser" class="form-control">
                    <option value="">请选择</option>
                    <c:forEach items="${userLists}" var="userListss">
                        <option value="${userListss.departUser}">${userListss.departUser}</option>
                    </c:forEach>
                </select>
        </div>
    </div>

    <div class="form-group">
    <label class="col-sm-2 control-label no-padding-right" for="operatorUser">经办人</label>
    <div class="col-sm-4">
       <%-- <input type="text" name="operatorUser" id="operatorUser" placeholder="经办人" value="${taskjob.operatorUser}"
               class="form-control ">--%>
           <select name="operatorUser" id="operatorUser" class="form-control">
               <option value="">请选择</option>
               <c:forEach items="${userLists}" var="userListss">
                   <option value="${userListss.departUser}">${userListss.departUser}</option>
               </c:forEach>
           </select>
    </div>
    <%-- <label class="col-sm-2 control-label no-padding-right" for="">承办单位</label>
     <div class="col-sm-4">
         <select name="involveUnit" id="" class="form-control departments" multiple="multiple">
             <optgroup label="">
                 <option value="1">林业局</option>
                 <option value="2">公安局</option>

                      <c:forEach items="${deptLists}" var="deptLists">
                          <c:if test="${deptLists.branchType == 'selected'}">
                              <option value="${deptLists.branch}" selected>${deptLists.branch}</option>
                          </c:if>
                          <c:if test="${deptLists.branchType == 'noSelected'}">
                              <option value="${deptLists.branch}">${deptLists.branch}</option>
                          </c:if>
                      </c:forEach>

             </optgroup>
         </select>
     </div>
 </div>--%>
    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right" for="fgLeader">分管领导</label>
        <div class="col-sm-4">
            <%--<input type="text" name="fgLeader" id="fgLeader" placeholder="分管领导" value="${taskjob.fgLeader}"
                   class="form-control ">--%>
                <select name="fgLeader" id="fgLeader" class="form-control">
                    <option value="">请选择</option>
                    <c:forEach items="${userLists}" var="userListss">
                        <option value="${userListss.departUser}">${userListss.departUser}</option>
                    </c:forEach>
                </select>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right">佐证材料</label>
        <input class="col-sm-4" type="file" id="fileupload" name="files"></input> <br>

        <button class="col-sm-4 btn btn-large btn-primary" id="btn-upload">上传</button>

        <input type="text" name="taxproof" id="taxproof_proof"
               value="${summaryFilter.taxproof}" class="form-control " style="display: none"/>
            <%--   <input type="text" name="isaudit" id="isaudit_sta"
                      value="${summaryFilter.isaudit}" class="form-control " style="display: none"
               />
               <input type="text" name="teamClass" id="teamClass"
                      value="${summaryFilter.teamClass}" class="form-control " style="display: none"
               />
               <input type="text" name="datatime" id="datatime"
                      value="${summaryFilter.datatime}" class="form-control " style="display: none"
               />
               <input type="text" name="firstReportDate" id="firstReportDate"
                      value="${summaryFilter.firstReportDate}" class="form-control " style="display: none"
               />
               <input type="text" name="remark"
                      value="${summaryFilter.remark}" class="form-control " style="display: none"
               />
               <input type="text" id="sys-Id"
                      value="${summaryFilter.sysId}" class="form-control " style="display: none"
               />--%>

    </div>


    <%--任务id  隐藏--%>
    <input type="text" id="taskId" value="${taskjob.sysId}" hidden>
    <form:hidden path="sysId"/>

</form:form>
<script src="<s:url value="/assets/js/chosen.jquery.js"></s:url>"></script>
<script src="<s:url value="/assets/js/ajaxfileupload.js"></s:url>"></script>
<script src="<s:url value="/assets/js/modal/modal.js"></s:url>"></script>


<script>
    //承办单位
    // $('.departments').fSelect();

    jQuery(function ($) {
        $(".date-picker").datepicker({
            inline: true,
            format: "yyyymmdd",
            autoclose: true,
            todayHighlight: true,
            language: 'cn'
        }).next().on(ace.click_event, function () {
            $(this).prev().focus();
        });
    });


    $("#btn-upload").click(function () {
        var fileval = $("#fileupload").val();
        if (fileval == null || fileval == "") {
            alert("未选择任何文件");
            return;
        }

        $(".shade").fadeIn(100);
        $(".warning").fadeIn(100);
        $('.la-square-jelly-box').show();
        showShade();
        //警告框自定义内容
        $('.warning>.title>em').html('加载中……');
        $.ajaxFileUpload({
            type: "post",
            fileElementId: "fileupload",
            secureuri: false,
            dataType: 'text',
            url: "/filesUpload/uploadBatch",
            // data:fileinfo,
            async: false,
            success: function (data) {
                var data = JSON.parse(data);
                console.log(data);
                var val = data.data.sysid;
                console.log(val);
                $("#taxproof_proof").attr("value", val);
                if (data.code === "200") {
                    $('.warning>.title>em').html('上传成功');
                } else {
                    $('.warning>.title>em').html('上传失败');
                }
            },
            error: function (data) {
                /*$("#dialog").dialog("close");*/

                alert("佐证材料上传失败 ！！请联系管理员");
            }

        });

    });

</script>


